import request from '@/utils/request'

export function list(query) {
  return request({
    url: '/admin/v1/user/list',
    method: 'get',
    params: query
  })
}

export function detail(id) {
  return request({
    url: `/admin/v1/user/${id}`,
    method: 'get'
  })
}

export function add(data) {
  return request({
    url: '/admin/v1/user/add',
    method: 'post',
    data
  })
}

export function update(data) {
  return request({
    url: '/admin/v1/user/update',
    method: 'put',
    data
  })
}

export function updateStatus(userId, data) {
  return request({
    url: `/admin/v1/user/update/${userId}`,
    method: 'put',
    data
  })
}

export function resetPassword(data) {
  return request({
    url: `/admin/v1/user/resetPassword`,
    method: 'put',
    data
  })
}

export function del(data) {
  return request({
    url: '/admin/v1/user/delete',
    method: 'delete',
    data
  })
}

export function checkUsername(query) {
  return request({
    url: '/admin/v1/user/checkUsername',
    method: 'get',
    params: query
  })
}

export function checkEmail(query) {
  return request({
    url: '/admin/v1/user/delete',
    method: 'get',
    params: query
  })
}

export function checkMobile(query) {
  return request({
    url: '/admin/v1/user/delete',
    method: 'get',
    params: query
  })
}


export function updateUserInfo(query) {
  return request({
    url: '/admin/v1/user/updateUserInfo',
    method: 'put',
    params: query
  })
}
